<?php
    /* @var $this->view Core_View */
    class Admin_DefaultController extends Core_Controller
    {
        public function hasCall()
        {
            return true;
        }

        public function __call($name, $arguments)
        {
            $admin = new Admin_AdminController();
            return call_user_func_array(array($admin, $name), $arguments);
        }
        public function indexAction()
        {
            include sfdebug_file('request');
            $admin = new Admin_AdminController();
            $admin->indexAction();
        }
        
        public function loginAction()
        {
            $this->view->setTemplate('login');
            $this->view->render();
        }

        public function signAction()
        {
            $admin = new Admin_AdminController(false);
            $bean = new Admin_AdminBean();
            if ($admin->sign($bean)) {
                sfredirect('/admin');
            } else {
                sfresponse(0, $admin->getError());
            }
        }
    }